#!C:\Python31\python
import os;
import random;

n = 100000;
m = 100000;
print(str(n) + " " + str(m));
was = dict();
for i in range(m):
	if (random.randint(1, 10) == 1):
		k = 0;
	else: k = random.randint(1, n);
	if (k == 0):
		L = random.randint(1, n);
		R = random.randint(L, n);
		print("0 " + str(L) + " " + str(R));
	else: 
		print(k);
		if k in was:
			del was[k];
		else: was[k] = 1;

